<script type="text/javascript">
    $(document).ready(function(){ 
        $('#locationNo').focus().keyup(function(e){
            if(e.keyCode ==13){
                $('#code').show();
                $('#bang').show();
                $('#barcode').focus();
                $('#restext').html("正在获取数据……");
            }
        });
        $('#restr').hide();
        $('#code').hide();
        $('#bang').hide();
        
        $('#barcode').keyup(function(e){          
        var locationNo = $('#locationNo').val();
        var barcode = $('#barcode').val();
        $('#restr').show();
        if(e.keyCode ==13){
           $.post(
            '/admini/managestore/binding',
            {'locationNo':locationNo,'barcode':barcode},
            function(data){
                if(data==1){
                    $('#restext').html("绑定成功！");
                    history.go(0);
                }else{
                    $('#restext').html("绑定失败！");
                }
            },
            'text');
        }
       })
       
       $('#submit').click(function(){
            var locationNo = $('#locationNo').val();
            var barcode = $('#barcode').val();
            $('#restr').show();
            $.post(
            '/admini/managestore/binding',
            {'locationNo':locationNo,'barcode':barcode},
            function(data){
                 if(data==1){
                    $('#restext').html("绑定成功！");
                }else{
                    $('#restext').html("绑定失败！");
                }
            },
            'text');
       })
       
       $('#reset').click(function(){
           history.go(0);
       })
       
    });
     
</script>

<div style="margin-top:80px;margin-left:80px;width:520px;height:240px;background-color:#F7F7F7;padding-top:20px;padding-left:140px;">
    <span style="margin-left:120px;"><font size="5" color="#6F0886"><b>库位绑定</b></font></span>
    <form method="post">
    <table width="300px;" style="margin-top:18px;" id="formissue">
        <tr height="38px"><td>请输入库位号：</td><td><input type="text" name="locationNo" id="locationNo"></td></tr>
        <tr height="38px" id="code"><td>请输入条形码：</td><td><input type="text" name="barcode" id="barcode"></td></tr>
        <tr height="32px;" style="background-color:#7CF28B;" id="restr">
            <td colspan="2"><div id="restext" style="font-size:16px;padding-left:88px;">正在获取数据...</div> </td>
        </tr>
        <tr height="52px" id="bang" align="center">
            <td>
                <input type="button" name="submit" id="submit" value="绑定" style="background-color: #FF8312;width: 68px;height: 32px;color: white;font-size: 16px;border-radius:8px;cursor: pointer;"/>
            </td>
            <td>
                 <input type="button" name="reset" id="reset" value="重置" style="background-color: #FF8312;width: 68px;height: 32px;color: white;font-size: 16px;border-radius:8px;cursor: pointer;"/>
            </td>
        </tr>
    </table>
    </form>
</div>